From 246549323752c58509b1fd9bb322fdd127f9ee21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?utf8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Mon, 18 Jul 2016 10:32:04 +0000 Subject: [PATCH] Try to delete any existing W32 status icons when DPI changes Fixes some or all of the issues reported in https://github.com/hexchat/hexchat/issues/1423 --- gtk/deprecated/gtkstatusicon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gtk/deprecated/gtkstatusicon.c b/gtk/deprecated/gtkstatusicon.c index a29c1b7ede..7df11cdec1 100644 --- a/gtk/deprecated/gtkstatusicon.c +++ b/gtk/deprecated/gtkstatusicon.c @@ -728,6 +728,12 @@ wndproc (HWND hwnd, GtkStatusIcon *status_icon = GTK_STATUS_ICON (rover->data); GtkStatusIconPrivate *priv = status_icon->priv; + /* taskbar_created_msg is also fired when DPI changes. Try to delete existing icons if possible. */ + if (!Shell_NotifyIconW (NIM_DELETE, &priv->nid)) + { + g_warning (G_STRLOC ": Shell_NotifyIcon(NIM_DELETE) on existing icon failed"); + } + priv->nid.hWnd = hwnd; priv->nid.uID = status_icon_id++; priv->nid.uCallbackMessage = WM_GTK_TRAY_NOTIFICATION; -- 2.30.2